<p>This tests for a bug where changing focus away from a textarea that has been emptied out by the Undo operation would clear the Undo stack. You should see a textarea with "foo" inside it below.</p>
<textarea id="textarea"></textarea>

<script>
if (window.testRunner)
    testRunner.dumpAsText();
    
textarea = document.getElementById("textarea");
textarea.focus();
document.execCommand("InsertText", false, "foo");
document.execCommand("Undo");
textarea.blur();
document.execCommand("Redo");
if (textarea.value == "foo")
    document.write("Success: Redo worked after the textarea lost focus.");
else
    document.write("Failure: Redo didn't work after the textarea lost focus.");
</script>
